import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { Language } from "../../../../../extend/language/Language";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { KingChampionShipKillRank } from "./KingChampionShipKillRank";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GTabBar } from "../../../../../com/mui/controls/GTabBar";
type int = number;
//class KingChampionShipRankPanel
    
    export  class KingChampionShipRankPanel extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(680, 500);
            this.title = Language.getString(60973);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(20, 60, 640, 392, this);
            ObjCreate.createBg(19, 58, 643, 35, this, ImagesConst.RbListHeader);
            var loc1=0;
            while (loc1 < 9) 
            {
                ObjCreate.createBg(30, 127 + loc1 * 36, 620, 2, this, ImagesConst.SplitLine);
                ++loc1;
            }
            this._tabBar = ObjCreate.createGTabBar(18, 34, Language.getArray(60987), 63, 22, this, this.onTabBarChangeHandler);
            this.showRank(0);
            return;
        }

        /* internal  */onTabBarChangeHandler(arg1): void
        {
            this.showRank(this._tabBar.selectedIndex);
            return;
        }

        public showRank(arg1: int): void
        {
            if (this._tabBar.selectedIndex != arg1) 
            {
                this._tabBar.selectedIndex = arg1;
            }
            var loc1=arg1;
            switch (loc1) 
            {
                case 0:
                {
                    if (!this._rank0) 
                    {
                        this._rank0 = new KingChampionShipKillRank();
                        this._rank0.x = 20;
                        this._rank0.y = 60;
                    }
                    this.addChild(this._rank0);
                    this._rank0.getRankData();
                    break;
                }
            }
            return;
        }

        public updateRankData(arg1: int, arg2: DataProvider, arg3: int, arg4: int): void
        {
            if (this._tabBar.selectedIndex != arg1) 
            {
                return;
            }
            if (arg1 == 0) 
            {
                this._rank0.updateRankData(arg2, arg3, arg4);
            }
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            super.dispose(arg1);
            if (this._rank0) 
            {
                this._rank0.dispose();
            }
            return;
        }

        /* internal */ /* var */_tabBar: GTabBar;

        /* internal */ /* var */_rank0: KingChampionShipKillRank;
    }
